const crypto = require('crypto');

// 生成随机盐值并使用sha512算法进行哈希加密
const password = 'myPassword';
const salt = crypto.randomBytes(16).toString('hex');
const hash = crypto.pbkdf2Sync(password, salt, 10000, 64, 'sha512').toString('hex');

console.log(`密码：${password}`);
console.log(`盐值：${salt}`);
console.log(`哈希值：${hash}`);
